home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
vol_100
/
163_01
/
fseek2.c
< prev
next >
Wrap
Text File
|
1988-01-30
|
640b
|
18 lines
/*
** reposition a stream file
*/
#define FILE int
#include <streamio.h>
extern int fflush(), _seek(), free();
fseek2(stream, offset, ptrname) FILE *stream; int offset, ptrname; {
fflush(stream); /* flush any write data */
if(stream[_IOB_CNT]) { /* free read buffer if present */
free(stream[_IOB_BASE]);
stream[_IOB_CNT] = 0;
}
stream[_IOB_FLAG] &= ~(_UNGET);
_seek(stream[_IOB_FD], offset, ptrname);
return 0;
}